package com.hyt.schedule;

import com.hyt.application.service.OutwardRemittanceService;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.asm.Advice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @see @Order注解的执行优先级是按value值从小到大顺序。
 * 项目启动完毕后开启需要自启的任务
 */

@Component
@Order(value = 1)
@Slf4j
public class ScheduledTaskRunner implements ApplicationRunner {

    @Autowired
    ScheduledTask01 task01;


    @Override
    public void run(ApplicationArguments applicationArguments) throws Exception {
        log.info(" >>>>>> 项目启动完毕, 开启 => 需要自启的任务 开始!");
        task01.test();
        log.info(" >>>>>> 项目启动完毕, 开启 => 需要自启的任务 结束！");
    }

}
